var express = require('express');
var router = express.Router();
var mongoose = require('mongoose');
var articleSchema = require('../model/articleDB.js'); 
var db1 = mongoose.createConnection('mongodb://127.0.0.1:27017/article'); // 链接数据库
var article = db1.model('article', articleSchema);
var debug = require("debug")("mydebug:view")

/* GET home page. */
router.get('/', function(req, res, next) {
  //res.render('view', { title: 'Express', content:"aaaa" });
  article.find(function (err, article) {
    res.render('view', { title: 'Express', content: article });
  });
  
});

module.exports = router;
